package com.gopay.bis.pab.ebank.impl;

import com.gopay.bis.pab.ebank.operation.PabB2bQueryOrder;
import com.gopay.common.domain.bank.BaseMessage;
import com.gopay.common.domain.bank.pab.ebank.PabB2bMessage;
import com.gopay.common.domain.bank.pab.ebank.PabOrderMessageRes;
import com.gopay.common.domain.bank.pab.ebank.PabQueryOrdersMessageRes;
import com.gopay.common.exception.GopayException;
import com.gopay.remote.bank.ICertHelper;
import com.gopay.remote.bank.businesses.BankService;

public class PabB2bBankServiceImpl implements BankService {

	private ICertHelper pabB2bCerthelper;
	private PabB2bQueryOrder pabB2bQueryOrder;

	public Object sign(BaseMessage msg) throws GopayException {
		PabB2bMessage message = (PabB2bMessage) msg;
		return pabB2bCerthelper.sign(message);

	}

	public Object verify(BaseMessage msg) throws GopayException {
		boolean flag = false;

		PabOrderMessageRes message = (PabOrderMessageRes) msg;
		flag = (Boolean) pabB2bCerthelper.verify(message);

		return flag;
	}

	public Object query(Object obj) throws GopayException {
		BaseMessage base = (BaseMessage) obj;
		PabQueryOrdersMessageRes b2bmsg = pabB2bQueryOrder.query(base);
		return b2bmsg;
	}

	
	public ICertHelper getPabB2bCerthelper() {
		return pabB2bCerthelper;
	}

	public void setPabB2bCerthelper(ICertHelper pabB2bCerthelper) {
		this.pabB2bCerthelper = pabB2bCerthelper;
	}

	public PabB2bQueryOrder getPabB2bQueryOrder() {
		return pabB2bQueryOrder;
	}

	public void setPabB2bQueryOrder(PabB2bQueryOrder pabB2bQueryOrder) {
		this.pabB2bQueryOrder = pabB2bQueryOrder;
	}

	@Override
	public Object dayend(Object obj) throws GopayException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object refund(Object obj) throws GopayException {
		// TODO Auto-generated method stub
		return null;
	}

}
